#ifndef _EDITOR_BRUSH_H_
#define _EDITOR_BRUSH_H_

#include "input/keyboard.h"
#include "input/mouse.h"
#include <string>
namespace LuaPlus
{
	class LuaState;	
}

namespace editor
{

class GameBase;
class EditorMain;
class	EditorBrush
{
public:
	EditorBrush(EditorMain* pEditor) : m_pEditor(pEditor), m_Rotation(0), m_ClampedValue(1), m_IsDone(false) {};
	virtual ~EditorBrush() {};
	virtual void	Render(const math::Vec2& Offset, float Scale) = 0;
	virtual void	Tick(float dt) {};
	virtual void	PressLMB() {};
	virtual void	ReleaseLMB() {};
	virtual bool	TryDelete(const math::Vec2& Pos) { return false; };		// see if we have any sub-components wants deleting
	virtual void	Raise(int Dir) { };
	virtual void	ToggleA() {};
	virtual void	ToggleB() {};
	virtual void	OnEnter() {};
	virtual void	Resize(const math::Vec2& Delta) {};
	virtual void	RotateGrid(int Dir) { Rotate(Dir); };
	virtual void	ChangeParalax(int Dir) {};
	virtual void	Rotate(int Dir)	{	};
	virtual void	AdjustClamp(float Dir)
	{
		m_ClampedValue+=Dir;
		if (m_ClampedValue < 0) m_ClampedValue = 0;
		if (m_ClampedValue > 1) m_ClampedValue = 1;
	}
	virtual void*			GetValue() { return NULL; };
	virtual bool			ShouldDelete() const { return m_IsDone; };

	float					GetScale();
	virtual void			RenderHelp();
	const std::string&		GetHelp() const { return m_HelpText; };

	virtual math::Vec2		GetOffset();
	virtual math::Vec2		GetPos();
	GameBase*				GetGame();

	void					SetDone() { m_IsDone = true; };
	bool					IsDone() const { return m_IsDone ; };
	virtual void			UpdateSelection(const std::string& Name) {};	// input from selection


	const std::string&		GetName() const { return m_Name;  };
	void					SetName(const std::string&		Name) { m_Name = Name;  };


	static bool				ShiftDown();
	static bool				CtrlDown();
	static bool				AltDown();

protected:
	EditorMain*		m_pEditor;
	std::string		m_Name;
	int				m_Rotation;
	float			m_ClampedValue;
	bool			m_IsDone;
	std::string		m_HelpText;
};




}


#endif //_EDITOR_BRUSH_H_